<template>
  <div>
    <div class="title">其他设置</div>
    <el-form :model="form" label-width="180px">
      <div class="box-title">直播设置：</div>

      <el-form-item label="直播开发范围：">
        <el-radio-group v-model="form.liveRange">
          <el-radio label="1">所有用户</el-radio>
          <el-radio label="2">马甲用户</el-radio>
        </el-radio-group>
      </el-form-item>
      <div class="box-title">提现设置：</div>

      <el-form-item label="是否设置提现审核：">
        <el-radio-group v-model="form.withdrawalAudit">
          <el-radio label="1">是</el-radio>
          <el-radio label="2">否</el-radio>
        </el-radio-group>
      </el-form-item>
      <div class="box-title">提现设置：</div>


      <div class="box">

        <el-form-item label="首次提现钻石：">
          <el-input size="small" v-model="form.withdrawalFirst"></el-input>
        </el-form-item>

        <el-form-item label="最低提现钻石：">
          <el-input size="small" v-model="form.withdrawalMin"></el-input>
        </el-form-item>
      </div>

      <el-form-item label="是否设置员工密码重置：">
        <el-radio-group v-model="form.pwdReset">
          <el-radio label="1">是</el-radio>
          <el-radio label="2">否</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item size="large">
        <el-button size="small" @click="$router.go(-1)">返回</el-button>
        <el-button type="primary" size="small" @click="updateOtherSetup">保存</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
  import apis from "../../../apis/modules/otherSetting"
  export default {
    data() {
      return {
        form: {
          liveRange: '',
          pwdReset:'',
          withdrawalAudit:'',
          withdrawalFirst:'',
          withdrawalMin:''
        },
      };
    },
    methods: {
      //获取其他设置
      getOtherSetup(){
        apis.getOtherSetup().then((res) => {
          if (res.code == 200) {
            this.form = res.data;
          }
        });
      },
      //修改其他设置
      updateOtherSetup(){
        apis.updateOtherSetup(this.form).then((res) => {
          if (res.code == 200) {
            this.$message.success('保存成功');
          }
        });
      }
    },
    mounted(){
      this.getOtherSetup();
    }
  }
</script>
<style lang="scss" scoped>
  .title {
    margin-bottom: 32px;
  }

  .box-title {
    color: #333;

  }

  .box {
    display: flex;
  }
</style>